﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using DAL.Service.Impl;
using DAL.Service;
using DomainModel;

namespace BIZ
{
    public class VipCenterOper
    {
        IDirectoryListService dls = new DirectoryListServiceImpl();
        IUserInfoService ui = new UserInfoServiceImpl();
        ILibraryBookIndentService bis = new LibraryBookIndentServiceImpl();

        public IList getDirectoryList(string uid)
        {
            return dls.getDirectoryList(uid);
        }
        public int delDirectory(string id)
        {
            return dls.delDirectory(id);
        }

        public void addDirectory(int uid, string name)
        {
            DirectoryList di = new DirectoryList();
            di.dl_name = name;
            di.dl_time = DateTime.Now;
            di.dl_uid = uid;
            save(di);
        }

        public int appraisal(int id, string appraisal)
        {
            return bis.appraisal(id, appraisal);
        }
        public bool checkDirectoryName(int uid, string name)
        {
            return dls.checkDirectoryName(uid, name) > 0 ? true : false;
        }


        public int delUserSave(string ids)
        {
            return dls.delUserSave(ids);
        }
        public object save(object entity)
        {
            return dls.save(entity);
        }

        public void changepwd(string uid, string pwd)
        {
            ui.changepwd(uid, pwd);
        }

        public int recommend(int id)
        {
            return bis.recommend(id);
        }

        public IList DirectoryList(int uid, int id, int pageno, int pagesize)
        {
            return dls.DirectoryList(uid, id, pageno, pagesize);
        }

        public bool checkUserSaveCount(int id)
        {
            return dls.getUserSaveCount(id) > 0 ? true : false;
        }

        public IList LibraryBookIndentDetail(int pageno, int pagesize, int uid)
        {
            return bis.LibraryBookIndentDetail(pageno, pagesize, uid);
        }
    }
}
